<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
</head>
<body>
    <div id="box">
        {{count}}
        <button @click="handLeAdd1">add1-函数名</button>
        <!-- 自己传递参数需要添加$event属性 -->
        <button @click="handLeAdd2($event, 2)">add2-函数表达式,可以自己传对象</button>

        <ul @click="handleUlClick">
            <li @click.stop="handleLiClik">1111</li>
        </ul>

      
    </div>

    <script>
        new Vue ({
            el: '#box',
            data: {
                count:1
            },
            methods:{
                handLeAdd1(evt){
                    this.count ++
                },
                handLeAdd2(evt, data){
                    this.count += data
                },
                handleClick(evt){
                    //阻止冒泡
                    evt.stopPropagation();
                    console.log('handleClick')
                },
                handleUlClick(){
                    console.log('handleUlClick')
                }
            }
        })
    </script>
</body>
</html>